package cn.qw.springcache.controller;

import cn.qw.springcache.pojo.Employee;
import cn.qw.springcache.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class EmployeeController {
    @Autowired
    private EmployeeService service;

    @GetMapping("/emp/{id}")
    public Employee get(@PathVariable("id") Integer id) {
        return service.selectByPrimaryKey(id);
    }


}
